home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / dskut / mindos11.zip / MFS.H < prev    next >
C/C++ Source or Header  |  1991-04-05  |  3KB  |  97 lines

  1. /*  mfs.h       -- data about a Minix file system */
  2. /*  Copyright 1988,1991 Steven W. Harrold. All rights reserved. */
  3. /*  $Header: MFS.H_V 1.7 91/04/05 15:52:01 SWH Exp $ */
  4.  
  5. #define VERSION "1.1 (910405)"
  6.  
  7. /* Determine what compiler we are using.  The supported ones are:
  8. **
  9. **      TurboC
  10. **      Microsoft C
  11. */
  12.  
  13. #if defined(__TURBOC__)
  14. #define TURBOC
  15. #endif
  16.  
  17. #if defined(M_I86)
  18. #define MSC
  19. #endif
  20.  
  21.  
  22. #include    "mfs.x"
  23.  
  24. #define EXTERN      extern  /* used in *.h files */
  25. #define PRIVATE     static  /* PRIVATE x limits the scope of x */
  26. #define PUBLIC              /* PUBLIC is the opposite of PRIVATE */
  27. #define FORWARD             /* some compilers require this to be 'static' */
  28.  
  29. #define BOOL        int
  30. #define TRUE        1
  31. #define FALSE       0
  32.  
  33.  
  34. #define SECTOR_SIZE 512         /* physical sector size in bytes */
  35. #define BLOCK_SIZE  1024        /* # of bytes in a disk block */
  36. #define ZONE_SIZE   7           /* # of zones in an inode */
  37. #define NAME_SIZE   14          /* # of bytes in a directory component */
  38. #define SUPER_MAGIC 0x137F      /* magic number in super block */
  39. #define MAX_PATH    128         /* max length of path names */
  40.  
  41. #define I_TYPE          0170000     /* bits that tell inode type */
  42. #define I_REGULAR       0100000     /* regular file, not dir or spec */
  43. #define I_BLOCK_SPECIAL 0060000     /* block special file */
  44. #define I_DIRECTORY     0040000     /* i_mode says file is a directory */
  45. #define I_CHAR_SPECIAL  0020000     /* character special file */
  46. #define I_SET_UID_BIT   0004000     /* set effective uid on exec */
  47. #define I_SET_GID_BIT   0002000     /* set effective gid on exec */
  48. #define RWX_MODES       0000777     /* mode bits for r,w,x only */
  49. #define R_BIT           0000004     /* Rwx protection bit */
  50. #define W_BIT           0000002     /* rWx protection bit */
  51. #define X_BIT           0000001     /* rwX protection bit */
  52.  
  53. #define BOOT_BLOCK  0           /* block number of boot block */
  54. #define SUPER_BLOCK 1           /* block number of super block */
  55. #define ROOT_INODE  1           /* inode number for root directory */
  56.  
  57. #define DRIVES  "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
  58.  
  59. typedef unsigned char   byte ;
  60. typedef unsigned short  ushort ;
  61. typedef unsigned long   ulong ;
  62.  
  63.  
  64. struct super_block              /* super block, as it is on disk */
  65. {
  66.     ushort  s_ninodes ;
  67.     ushort  s_nzones ;
  68.     ushort  s_imap_blocks ;
  69.     ushort  s_zmap_blocks ;
  70.     ushort  s_firstdatazone ;
  71.     ushort  s_log_zone_size ;
  72.     ulong   s_max_size ;
  73.     ushort  s_magic ;
  74. } ;
  75.  
  76. struct inode                    /* an i-node */
  77. {
  78.     ushort  i_mode ;
  79.     ushort  i_uid ;
  80.     ulong   i_size ;
  81.     ulong   i_modtime ;
  82.     byte    i_gid ;
  83.     byte    i_nlinks ;
  84.     ushort  i_zone[ZONE_SIZE] ;
  85.     ushort  i_ind ;
  86.     ushort  i_dbl_ind ;
  87. } ;
  88.  
  89. struct directory                /* a directory block */
  90. {
  91.     ushort  d_inum ;            /* 0=empty entry */
  92.     char    d_name[NAME_SIZE] ; /* terminated by \0 char or maxlen */
  93. } ;
  94.  
  95.  
  96. /*---eof---*/
  97.